import { Col, Row } from "antd";
import WarpDiv from "./warp";
import { Tprops } from "./types";

export default function SortList(props:Tprops){
    const data = props.data.sort((a,b)=>b.value-a.value)
    return <WarpDiv>
        <div className="xxl-flex sort-list xxl-flex-column h100">
        <div className="title-show">{props.title}
            <span className="sub-title flr">{props.subTitle}</span>
        </div>
        <Row className="pinner info">
                <Col span={4}>排行</Col>
                <Col span={12}>地区</Col>
                <Col span={6}>租户数</Col>
            </Row>
        <div className="xxl-flex-1 list xxl-scroll">
            {data.map((v,i)=><Row className="ptb10 bbline items">
                <Col span={4}>{i+1}</Col>
                <Col span={12}>{v.labelName}</Col>
                <Col span={6}>{v.value}</Col>
            </Row>)}
        </div>
    </div></WarpDiv>
}